package com.zhkj.shixi.tvplayer.PicturePlayer;

import android.view.View;

/**
 * Created by linjing on 19-8-13.
 */

public class RotatePhoto {
    private int du;

    public RotatePhoto() {
        du = 0;
    }
    /**
     * @author linjing
     * @param view 要旋转的view
     * @param type 1向上旋转，-1向下选装
     */
    public void rotatePhoto(View view, int type) {
        if (type == 1) {
            du = (du + 270) % 360;
        }else{
            du = (du + 90) % 360;
        }
        view.setPivotX(view.getWidth() / 2);
        view.setPivotY(view.getHeight() / 2);
        view.setRotation(du);
    }



}
